<!DOCTYPE HTML>
<html>
<head>
    <!--Setting-->
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="IE=Edge,chrome=1">
    <meta http-equiv="Cache-Control" content="no-siteapp">
    <meta name="renderer" content="webkit|ie-comp|ie-stand">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <meta name="format-detection" content="telephone=no,email=no,adress=no">
    <meta name="browsermode" content="application">
    <meta name="screen-orientation" content="portrait">
    <link rel="dns-prefetch" href="http://jokerfortao.gitee.io">
    <!--SEO-->



<meta name="robots" content="all" />
<meta name="google" content="all" />
<meta name="googlebot" content="all" />
<meta name="verify" content="all" />
    <!--Title-->


<title>【javascript的那些事】等待加载完js后执行方法 | Samule&#39;s Blog</title>


    <link rel="alternate" href="/atom.xml" title="Samule&#39;s Blog" type="application/atom+xml">


    <link rel="icon" href="/favicon.ico">

    




    <link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/highlight.js/9.12.0/styles/default.min.css?rev=9.12.0">


<link rel="stylesheet" href="//cdn.bootcss.com/bootstrap/3.3.4/css/bootstrap.min.css?rev=3.3.4">
<link rel="stylesheet" href="//cdn.bootcss.com/font-awesome/4.7.0/css/font-awesome.min.css">
<link rel="stylesheet" href="/myblog/css/style.css?rev=@@hash">




    





    
</head>


<!--[if lte IE 8]>
<style>
    html{ font-size: 1em }
</style>
<![endif]-->
<!--[if lte IE 9]>
<div style="ie">你使用的浏览器版本过低，为了你更好的阅读体验，请更新浏览器的版本或者使用其他现代浏览器，比如Chrome、Firefox、Safari等。</div>
<![endif]-->

<body>
    <header class="main-header"  style="background-image:url(http://7xpw2b.com1.z0.glb.clouddn.com/hexo-sinppet/img/banner2.jpg)"  >
    <div class="main-header-box">
        <a class="header-avatar" href="/" title="">
            <img src="/myblog/img/avatar.jpg" alt="logo头像">
        </a>
        <div class="branding">
        	<!--<h2 class="text-hide">Snippet主题,从未如此简单有趣</h2>-->
            
                 <img src="/myblog/img/branding.png" alt="Snippet 博客主题">  
             
    	</div>
    </div>
</header>
    <nav class="main-navigation">
    <div class="container">
        <div class="row">
            <div class="col-sm-12">
                <div class="navbar-header"><span class="nav-toggle-button collapsed" data-toggle="collapse" data-target="#main-menu" id="mnav">
                    <span class="sr-only">Toggle navigation</span>
                    <i class="fa fa-bars"></i>
                    </span>
                </div>
                <div class="collapse navbar-collapse" id="main-menu">
                    <ul class="menu">
                        
                            <li role="presentation"><a href="/myblog"><i class="fa fa-fw "></i>Home</a>
                            </li>
                        
                            <li role="presentation"><a href="/myblog/categories/java/"><i class="fa fa-fw "></i>java</a>
                            </li>
                        
                            <li role="presentation"><a href="/myblog/categories/spring/"><i class="fa fa-fw "></i>spring</a>
                            </li>
                        
                            <li role="presentation"><a href="/myblog/categories/db/"><i class="fa fa-fw "></i>db</a>
                            </li>
                        
                            <li role="presentation"><a href="/myblog/categories/tools/"><i class="fa fa-fw "></i>tools</a>
                            </li>
                        
                    </ul>
                </div>
            </div>
        </div>
    </div>
</nav>
    <section class="content-wrap">
        <div class="container">
            <div class="row">
                <main class="col-md-8 main-content m-post">
                    <p id="process"></p>
<article class="post">
    <div class="post-head">
        <h1 id="【javascript的那些事】等待加载完js后执行方法">
            
            【javascript的那些事】等待加载完js后执行方法
            
        </h1>
        <div class="post-meta">
    
    
    <span class="categories-meta fa-wrap">
        <i class="fa fa-folder-open-o"></i>
        <span>前端</span>
    </span>
    
    
    <span class="fa-wrap">
        <i class="fa fa-tags"></i>
        <span class="tags-meta">
            
            js
            
        </span>
    </span>
    
    
    <span class="fa-wrap">
        <i class="fa fa-clock-o"></i>
        <span class="date-meta">2017/05/23</span>
    </span>
</div>

            
            
    </div>
    
    <div class="post-body post-content">
        <p>【摘要】很多时候，你也许会碰到 使用的情景： js文件b.js还没有从服务器端加载到web端，而吧a.js中已经调用了b.js中的方法 实例： 这里是加载echart的时候碰到的具体实例 引入js 需要调用 echarts 中的 init() ,如果没有加载好 echarts.common.min.js，就 <a href="http://www.cnblogs.com/Profound/p/6895221.html" target="_blank" rel="noopener">阅读全文</a></p>

    </div>

    <div class="post-footer">   
        <div>
            
                转载声明：商业转载请联系作者获得授权,非商业转载请注明出处 © <a href="" target="_blank">Samuel</a>
            
        </div>
        <div>
            
        </div>  
    </div>
</article>

<div class="article-nav prev-next-wrap clearfix">
    
        <a href="/myblog/2017/06/02/对JAVA集合进行遍历删除时务必要用迭代器-Coder-Samuel/" class="pre-post btn btn-default"><i class="fa fa-angle-left fa-fw"></i>上一篇</a>
    
    
        <a href="/myblog/2017/05/03/【微信H5】-Redirect-uri参数错误解决方法-Coder-Samuel/" class="next-post btn btn-default">下一篇<i class="fa fa-angle-right fa-fw"></i></a>
    
</div>






                </main>
                
    <aside class="col-md-4 sidebar">
        
        
    <div class="widget">    
        <h3 class="title">Search</h3>
        <div id="search-form">
            <div id="result-mask" class="hide"></div>
            <div class="search-area">
                
                    <input id="search-key" type="search" autocomplete="off" placeholder="搜点什么呢?">
                    <button type="button" class="search-form-submit" id="search-local">localSearch</button>
                
                
            </div>
            <div id="result-wrap" class="hide">
                <div id="search-result"></div>
            </div>
            <div class="hide">
                <template id="search-tpl">
                    <div class="item">
                        <a href="/{path}" title="{title}">
                            <div class="title">{title}</div>
                            <div class="content">{content}</div>
                        </a>
                    </div>
                </template>
            </div>
        </div>
    </div>

        
        
    <div class="widget notification">
        <h3 class="title">网站公告</h3>
        <div>
            <p>个人技术博客 <br/>
 欢迎来搞 <br/>
<hr/>单调且低调
</p>
        </div>
    </div>

        
        
    <div class="widget">
      <h3 class="title">Social</h3> 
        <div class="content social">
            
	            <a href="//gitee.com/jokerForTao/" rel="external nofollow" title="Github" target="_blank">
			    	<i class="git fa fa-git"></i>
			    </a>
            
	            <a href="mailto:taozi1006@gamil.com" rel="external nofollow" title="邮箱" target="_blank">
			    	<i class="envelope-o fa fa-envelope-o"></i>
			    </a>
            
	            <a href="/" rel="external nofollow" title="联系QQ" target="_blank">
			    	<i class="qq fa fa-qq"></i>
			    </a>
            
	            <a href="/" rel="external nofollow" title="微博" target="_blank">
			    	<i class="weibo fa fa-weibo"></i>
			    </a>
            
	            <a href="/" rel="external nofollow" title="QQ群" target="_blank">
			    	<i class="users fa fa-users"></i>
			    </a>
            
	            <a href="/atom.xml" rel="external nofollow" title="RSS" target="_blank">
			    	<i class="feed fa fa-feed"></i>
			    </a>
            
        </div>
    </div>


        
        
    <div class="widget">
        <h3 class="title">Categories</h3>
        <ul class="category-list"><li class="category-list-item"><a class="category-list-link" href="/myblog/categories/db/"><i class="fa" aria-hidden="true">db</i></a><span class="category-list-count">2</span></li><li class="category-list-item"><a class="category-list-link" href="/myblog/categories/java/"><i class="fa" aria-hidden="true">java</i></a><span class="category-list-count">1</span></li><li class="category-list-item"><a class="category-list-link current" href="/myblog/categories/spring/"><i class="fa" aria-hidden="true">spring</i></a><span class="category-list-count">5</span></li><li class="category-list-item"><a class="category-list-link" href="/myblog/categories/tools/"><i class="fa" aria-hidden="true">tools</i></a><span class="category-list-count">4</span></li><li class="category-list-item"><a class="category-list-link" href="/myblog/categories/前端/"><i class="fa" aria-hidden="true">前端</i></a><span class="category-list-count">2</span></li></ul>
    </div>


        
        
    <div class="widget">
      <h3 class="title">Archives</h3>
        <ul class="archive-list"><li class="archive-list-item"><a class="archive-list-link" href="/myblog/archives/2017/12/"><i class="fa" aria-hidden="true">December 2017</i></a><span class="archive-list-count">5</span></li><li class="archive-list-item"><a class="archive-list-link" href="/myblog/archives/2017/10/"><i class="fa" aria-hidden="true">October 2017</i></a><span class="archive-list-count">1</span></li><li class="archive-list-item"><a class="archive-list-link" href="/myblog/archives/2017/08/"><i class="fa" aria-hidden="true">August 2017</i></a><span class="archive-list-count">4</span></li><li class="archive-list-item"><a class="archive-list-link" href="/myblog/archives/2017/07/"><i class="fa" aria-hidden="true">July 2017</i></a><span class="archive-list-count">1</span></li><li class="archive-list-item"><a class="archive-list-link" href="/myblog/archives/2017/06/"><i class="fa" aria-hidden="true">June 2017</i></a><span class="archive-list-count">1</span></li><li class="archive-list-item"><a class="archive-list-link" href="/myblog/archives/2017/05/"><i class="fa" aria-hidden="true">May 2017</i></a><span class="archive-list-count">2</span></li></ul>
    </div>


        
        
  <div class="widget">
    <h3 class="title">Tag Cloud</h3>
    <div class="content tag-cloud">
        <a href="/myblog/tags/DDD/" style="font-size: 10px;">DDD</a> <a href="/myblog/tags/collection/" style="font-size: 10px;">collection</a> <a href="/myblog/tags/db/" style="font-size: 15px;">db</a> <a href="/myblog/tags/h2/" style="font-size: 10px;">h2</a> <a href="/myblog/tags/hexo/" style="font-size: 15px;">hexo</a> <a href="/myblog/tags/js/" style="font-size: 15px;">js</a> <a href="/myblog/tags/mac/" style="font-size: 10px;">mac</a> <a href="/myblog/tags/maven/" style="font-size: 10px;">maven</a> <a href="/myblog/tags/mysql/" style="font-size: 10px;">mysql</a> <a href="/myblog/tags/node/" style="font-size: 10px;">node</a> <a href="/myblog/tags/spring/" style="font-size: 20px;">spring</a> <a href="/myblog/tags/spring-boot/" style="font-size: 15px;">spring boot</a> <a href="/myblog/tags/spring-cloud/" style="font-size: 10px;">spring cloud</a> <a href="/myblog/tags/spring-source/" style="font-size: 10px;">spring-source</a> <a href="/myblog/tags/theme/" style="font-size: 10px;">theme</a> <a href="/myblog/tags/tools/" style="font-size: 10px;">tools</a> <a href="/myblog/tags/集合/" style="font-size: 10px;">集合</a>
    </div>
  </div>


        
        
    <div class="widget">
        <h3 class="title">Friends</h3>
        <div class="content friends-link">
        
            <a href="http://jokerfortao.gitee.io/myblog/" class="fa" target="_blank">个人博客</a>
        
        </div>
    </div>


        
    </aside>

            </div>
        </div>
    </section>
    <footer class="main-footer">
    <div class="container">
        <div class="row">
        </div>
    </div>
</footer>

<a id="back-to-top" class="hide">
	<i class="fa fa-chevron-up"></i>
</a>




    <div class="copyright">
    <div class="container">
        <div class="row">
            <div class="col-sm-12"> 
                <span>Copyright &copy; 2017
                </span> | 
                <span>
                    Powered by <a href="//hexo.io" class="copyright-links" target="_blank" rel="nofollow">Hexo</a>
                </span> | 
                <span>
                    Theme by <a href="//github.com/shenliyang/hexo-theme-snippet.git" class="copyright-links" target="_blank" rel="nofollow">Snippet</a>
                </span>
            </div>
        </div>
    </div>
</div>


  <script src="/myblog/assets/highlight.pack.js?rev=@@hash"></script>
  <script>
     hljs.initHighlightingOnLoad(); //初始化代码高亮 
  </script>



	<script src="/myblog/js/search.js?rev=@@hash"></script>


<script src="/myblog/js/app.js?rev=@@hash"></script>


</body>
</html>